import _find from 'lodash/find'

const apiList = []

const contexts = require.context('.', false, /^((?!index).)*\.js$/)
contexts.keys().forEach(name => apiList.push(...contexts(name).default))

function findApi (name) {
  return _find(apiList, ['name', name])
}

export default apiList
export {
  findApi
}
